package main

import (
	"fmt"
)

func main() {

	s3 := make([]int, 5, 10)
	fmt.Println(s3)
	fmt.Println("长度 :", len(s3))
	fmt.Println("容量 :", cap(s3))

	s3[0] = 100
	s3[1] = 200
	fmt.Println(s3)
	//长度为5  容量为10  还是只能根据长度来赋值
	//panic: runtime error: index out of range [6] with length 5
	//s3[6] = 2
	//fmt.Println(s3[6])

	var s2 []int
	s2 = []int{1, 2, 3}
	fmt.Println(s2)
	s4 := make([]int, 4, 5)
	fmt.Println(s4)
	s4[0] = 1

	map1 := make(map[string]int)
	fmt.Println(map1)
	map1["key"] = 2

}
